package com.mayikt.days005;

/**
 * @ClassName Test002
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test002 implements MyCallable<String> {
    @Override
    public String call() {
        try {
            Thread.sleep(3000);
            System.out.println(Thread.currentThread().getName() + ",发送短信完成。");
        } catch (Exception e) {

        }
        return "发送短信完成";
    }

    public static void main(String[] args) {
        MayiktTask<String> stringMayiktTask = new MayiktTask<>(new Test002());
        new Thread(stringMayiktTask).start();
        String s = stringMayiktTask.get();
        System.out.println(s);
    }
}
